package com.lx.mobileplayer.mvp.view.activity

import android.os.Bundle
import android.support.v4.view.ViewCompat
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter
import android.view.View
import com.lx.mobileplayer.R
import com.lx.mobileplayer.utils.AppManager.goMainActivity
import kotlinx.android.synthetic.main.activity_splash.*

/**启动页
 * Created by liuxiong on 2019/4/22.
 */
class SplashActivity :BaseActivity(){
    override fun getContentLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        ViewCompat.animate(image_view).scaleX(1.0f).scaleY(1.0f).setDuration(1500).setListener(object:
            ViewPropertyAnimatorListenerAdapter(){
            override fun onAnimationEnd(view: View?) {
                goMainActivity(getMContext())

                finish()
            }
        }).start()
    }
}